<template>
    <div>
        <Header ref="gHeader" @onShowLogin="showLogin" @onLoginOut="loginOut"/>
        <router-view></router-view>
        <Footer/>
	    <Login :viewIndex="loginType" v-if="showLoginView"  @onClose="closeLogin" @onLoginSucc="loginSucc"/>
    </div>
</template>
<script>
import Login from '@/views/login/Login.vue';
import Header from '@/components/Header'
import Footer from '@/components/Footer'
export default {
    data(){
        return {
            loginType:1,
            showLoginView:false
        }
    },
    components:{Header,Footer,Login},
    methods:{
	  touchToClose:function(_isClose){
		  this.showLoginView = _isClose;
      },
      showLogin(_data){
          this.showLoginView=true;
          this.loginType=_data.loginType;
      },
      closeLogin(){
          this.showLoginView=false;
      },
      loginSucc(){
          this.$refs.gHeader.refreshLoginSucc();
      },
      loginOut(){
          this.$refs.gHeader.refreshLoginOut();
      }
    }
}
</script>